<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" class="globalSerchFormStyle">
      <el-row>
        <el-col :span="6">
          <el-form-item label="渠道名称" prop="labelName">
            <el-input v-model="queryParams.labelName" placeholder="请输入渠道名称" clearable size="small" style="width: 190px"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <!-- <el-form-item label="类型" prop="labelRuleType">
            <el-input
              v-model="queryParams.labelRuleType"
              placeholder="请输入类型"
              clearable
              size="small"
              style="width: 190px"
            />
          </el-form-item> -->
          <el-form-item label="渠道类型" prop="labelRuleType">
            <el-select v-model="queryParams.labelRuleType" filterable :clearable="true" placeholder="请选择类型">
              <el-option v-for="(item, index) in childData" :key="index" :label="item.dictLabel" :value="item.dictLabel">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="类型名称" prop="categoryName">
            <el-input v-model="queryParams.categoryName" placeholder="请输入类型名称" clearable size="small" style="width: 190px"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="创建日期" prop="beginTime">
            <el-date-picker v-model="queryParams.beginTime" value-format="yyyy-MM-dd" type="date" size="small" placeholder="选择开始日期" style="width: 190px">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="(创建)结束日期" prop="endTime" label-width="110px">
            <el-date-picker v-model="queryParams.endTime" value-format="yyyy-MM-dd" type="date" size="small" placeholder="选择结束日期" style="width: 190px">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row :gutter="10" class="global_el_rowStyle">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" >搜索</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" type="primary" plain >重置</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
                <el-button plain icon="el-icon-upload" size="mini" @click="handleImportAll">批量导入</el-button>
            </el-col> -->
    </el-row>

    <el-table v-loading="loading" :data="labelList" height="500">
      <!-- <el-table-column type="selection" width="55" /> -->
      <el-table-column label="序号" type="index" align="left">
        <template slot-scope="scope">
          <span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="渠道名称" align="left" prop="labelName" :show-overflow-tooltip="true"/>
      <el-table-column label="类型" align="left" prop="labelRuleType" :show-overflow-tooltip="true"/>
      <el-table-column label="类型名称" align="left" prop="categoryName" :show-overflow-tooltip="true"/>
      <el-table-column label="开始时间" align="left" prop="startDate" :show-overflow-tooltip="true"/>
      <el-table-column label="结束时间" align="left" prop="endDate" :show-overflow-tooltip="true"/>
      <el-table-column label="创建时间" align="left" prop="createTime" :show-overflow-tooltip="true"/>
      <el-table-column label="关联立减活动" align="left" prop="activityNames" :show-overflow-tooltip="true"/>
      <el-table-column label="关联优惠卷活动" align="left" prop="couponActivityNames" :show-overflow-tooltip="true"/>
      <el-table-column label="使用人数" align="left" prop="userscount" />
      <!-- <el-table-column label="活动名称" align="left" prop="activityName" :show-overflow-tooltip="true"/>
    
      <el-table-column label="创建日期" align="left" prop="createTime" /> -->
      <el-table-column label="启用状态" align="left" prop="status">
        <template slot-scope="scope">
          <el-switch v-model="scope.row.status" @change="handleChangeStatus(scope.row)">
          </el-switch>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="left" width="380" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)" >编辑</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" >删除</el-button>
          <el-button size="mini" type="text" @click="handleOptional(scope.row)">分配</el-button>
          <el-button plain type="text" icon="el-icon-edit" size="mini" @click="showUpload(scope.row)" >批量导入</el-button>
          <el-button size="mini" type="text" @click="handleUserDetailed(scope.row)" >分配明细</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="float: right">
      <el-pagination style="padding-top: 15px" @size-change="SizeChange" @current-change="currentPageChange" :current-page.sync="page" background :page-count="6" :page-sizes="[5, 10, 20, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
      </el-pagination>
    </div>

    <!-- 标签分配用户(可选的用户) -->
    <el-dialog title="分配渠道" :visible.sync="allocationLabelVisible" :close-on-click-modal="false">
      <el-form :model="optionalUserForm" :inline="true" ref="optionalUserForm" label-position="left" label-width="60px">
        <el-form-item label="姓名:" prop="customerName">
          <el-input v-model="optionalUserForm.customerName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="手机号:" prop="phone">
          <el-input v-model="optionalUserForm.phone" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item class="fr">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleOptionalUserQuery" >搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetOptionalUserQuery" >重置</el-button>
        </el-form-item>
      </el-form>
      <el-table :data="optionalUserList" height="400" v-loading="optionalUserLoading" @selection-change="optionalUserSelectionChange">
        <el-table-column type="selection" width="55" />
        <el-table-column label="序号" type="index" width="100">
          <template slot-scope="scope">
            <span>{{(optionalUserPage - 1) * optionalUserPageSize + scope.$index + 1}}</span>
          </template>
        </el-table-column>
        <el-table-column property="customerName" label="用户名称"></el-table-column>
        <el-table-column property="phone" label="手机号" width="200"></el-table-column>
      </el-table>
      <div style="text-align: right">
        <el-pagination style="padding-top: 15px" @size-change="optionalUserSizeChange" @current-change="optionalUserCurrentPageChange" :current-page.sync="optionalUserPage" background :page-count="6" :page-sizes="[5, 10, 20, 50, 100]" :page-size="optionalUserPageSize" layout="total, sizes, prev, pager, next, jumper" :total="optionalUserTotal">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="mini" @click="optionalUserSubmit">保存</el-button>
      </div>
    </el-dialog>

    <!-- 分配明细 -->
    <el-dialog title="分配明细预览" :visible.sync="userDetailedVisible" :close-on-click-modal="false">
      <el-form :model="userDetailedForm" :inline="true" ref="userDetailedForm" label-position="left" label-width="60px">
        <el-form-item label="姓名:" prop="customerName">
          <el-input v-model="userDetailedForm.customerName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="手机号:" prop="phone">
          <el-input v-model="userDetailedForm.phone" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item class="fr">
          <el-button type="primary" icon="el-icon-delete" size="mini" @click="onDeletions(1)" >批量移除</el-button>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleUserDetailedQuery" >搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetUserDetailedQuery" >重置</el-button>
        </el-form-item>
      </el-form>
      <el-table ref="multipleTable" :data="userDetailedList" height="400" v-loading="userDetailedLoading"  @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column label="序号" type="index" width="100">
          <template slot-scope="scope">
            <span>{{(userDetailedPage - 1) * userDetailedPageSize + scope.$index + 1}}</span>
          </template>
        </el-table-column>
        <el-table-column property="customerName" label="用户名称"></el-table-column>
        <el-table-column property="phone" label="手机号"></el-table-column>
        <el-table-column label="操作" align="left" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button size="mini" type="text" icon="el-icon-delete" @click="onDeletions(2,scope.row)">移除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="text-align: right">
        <el-pagination style="padding-top: 15px" @size-change="userDetailedSizeChange" @current-change="userDetailedCurrentPageChange" :current-page.sync="userDetailedPage" background :page-count="6" :page-sizes="[5, 10, 20, 50, 100]" :page-size="userDetailedPageSize" layout="total, sizes, prev, pager, next, jumper" :total="userDetailedTotal">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="mini" @click="userDetailedExport">导出明细</el-button
        >
      </div>
    </el-dialog>
    <labelForm ref="labelForm" :parm="params" @on-submit-new="getData" @on-submit-edit="getData" @childData="handleChildData"/>

    <!-- 批量导入 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body style="">
      <el-upload ref="upload" :before-upload="beforeAvatarUpload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '/' + upload.labelId" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div class="el-upload__tip" slot="tip">
          <el-link type="info" style="font-size: 12px" @click="importTemplate">下载模板</el-link>
        </div>
        <div class="el-upload__tip" style="color: red" slot="tip">
          提示：仅允许导入“xls”或“xlsx”格式文件！
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm" :loading="importLoading" >确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  labelList,
  addlabel,
  delLabel,
  updateLabel,
  selectNotCustomerLabelInfo,
  addAndDelCustomerLabel,
  selectPhoneList,
  selectCustomerLabelInfoListExport,
} from "@/api/label/new-label";
import { listReductionActivity } from "@/api/market/reductionActivity";
import { cloneDeep } from "lodash";
import labelForm from "./Label_Management_Form.vue";
import { getToken } from "@/utils/auth";
import request from "@/utils/request";

export default {
  components: { labelForm },
  data() {
    return {
      importLoading: false,
      // 用户导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // // 标签id
        labelId: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url:
          process.env.VUE_APP_BASE_API + "/customer/cardImport/importLabelUser",
      },

      labelRow: {}, // 行数据
      queryParams: {
        labelName: "",
        beginTime: "",
        endTime: "",
      },
      loading: false,
      labelList: [],
      total: 0,
      page: 1,
      pageSize: 10,
      allocationLabelVisible: false,
      optionalUserList: [], //可分配的用户
      optionalUserTotal: 0,
      optionalUserPage: 1,
      optionalUserPageSize: 10,
      optionalUserLoading: false,
      optionalUserForm: {
        customerName: "",
        phone: "",
      },
      optionalUserSelectList: [],
      userDetailedVisible: false,
      userDetailedForm: {
        customerName: "",
        phone: "",
      },
      userDetailedLoading: false,
      userDetailedList: [],
      userDetailedTotal: 0,
      userDetailedPageSize: 10,
      userDetailedPage: 1,
      params: {},
      childData: "",
      choosePhoneList:[],//选中人员
    };
  },
  methods: {
    // 批量删除人员
    onDeletions(val,row){
      let data={ 
          flag:1,
          labelId:this.labelRow.id,
      }
       if(val==1){ 
          data.phoneList=this.choosePhoneList||[]
        }else{ 
          data['phoneList']=[row.phone]
        }
      if(this.choosePhoneList.length==0&&val==1){ 
        this.$message.warning('请选择您要从渠道中移除的用户')
      }else if(this.choosePhoneList.length==1&&val==2){  
          if(this.choosePhoneList[0]==data['phoneList'][0]){ 
            this.$confirm( `确定从渠道中移除当前手机号为${this.choosePhoneList[0]}选中的用户吗？`).then(()=>{
            addAndDelCustomerLabel(data).then((res) => {
              if (res && res.code === 200) {
                this.$message.success("移除成功");
                this.choosePhoneList =[];
                this.gePhoneList()
                this.getData()
              } else {
                this.$message.error(res.msg);
              }
            });
          })
        }else{ 
          this.$message.warning('当前勾选与选择的不一致，请重新操作')
        }
        
      }else{ 
        if(this.choosePhoneList.length>1&&val==2){ 
          this.$message.warning('请选择批量移除')
        }else if(this.choosePhoneList.length&&val==1){ 
          const message=this.choosePhoneList.length==1?`确定从渠道中移除当前手机号为${this.choosePhoneList[0]}的用户吗？`: `确定从渠道中移除当前选中的${this.choosePhoneList.length}位用户吗？ `
          this.$confirm(`${message}`).then(()=>{
          addAndDelCustomerLabel(data).then((res) => {
              if (res && res.code === 200) {
                this.$message.success("移除成功");
                this.choosePhoneList =[];
                this.gePhoneList()
                this.getData()
              } else {
                this.$message.error(res.msg);
              }
            });
          })
        }else if(this.choosePhoneList.length==0&&val==2){ 
          this.$confirm( `确定从渠道中移除当前手机号为${row.phone}的用户吗？`).then(()=>{
          addAndDelCustomerLabel(data).then((res) => {
              if (res && res.code === 200) {
                this.$message.success("移除成功");
                this.choosePhoneList =[];
                this.gePhoneList()
                this.getData()
              } else {
                this.$message.error(res.msg);
              }
            });
          })
        }
      }
    },
    gePhoneList(){
      this.userDetailedLoading=true
      const queryData={
          pageNum: this.userDetailedPage,
          pageSize: this.userDetailedPageSize,
          labelId: this.labelRow.id,
        }
      selectPhoneList(queryData).then((res) => {
        if (res && res.code === 200) {
          this.userDetailedList = res.rows;
          this.userDetailedTotal = res.total;
        } else {
          this.userDetailedList = [];
          this.userDetailedTotal = 0;
        }
        this.userDetailedLoading = false;
      });
    },
    handleSelectionChange(val){
        let list=[]
        val.forEach(item=>{ 
          list.push(item.phone)
      })
        this.choosePhoneList = list||[];
    },
    handleChildData(dataFromChild) {
      this.childData = dataFromChild;
    },
    // 上传表格组件的校验
    beforeAvatarUpload(file) {
      const extension = file.name.split(".").pop().toLowerCase();
      console.log(extension);
      if (extension !== "xls" && extension !== "xlsx") {
        this.$message.error("仅允许导入“xls”或“xlsx”格式文件！");
        return false;
      }
      return true;
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
    async importTemplate() {
      let res = await request.get("/customer/cardImport/labelUserTemplate", {
        responseType: "blob",
        withCredentials: false,
      });
      const fileExt = "xlsx";
      const filename = "导入模版" + (fileExt ? "." + fileExt : "");
      const blob = new Blob([res]);
      var downloadElement = document.createElement("a");
      var href = window.URL.createObjectURL(blob);
      downloadElement.href = href;
      downloadElement.download = filename;
      document.body.appendChild(downloadElement);
      downloadElement.click();
      document.body.removeChild(downloadElement);
      window.URL.revokeObjectURL(href);
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
      this.importLoading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.importLoading = false;
      const tip = `<div style="height:60vh; overflow-y: auto;">${response.msg}</div>`;
      this.$alert(tip, "导入结果", { dangerouslyUseHTMLString: true });
    },
    // 打开批量导入
    showUpload(row) {
      this.upload.title = "批量导入";
      this.upload.open = true;
      this.upload.labelId = row.id;
    },
    // 查询
    handleQuery() {
      this.getData();
    },
    // 重置
    resetQuery() {
      this.resetForm("queryForm");
      this.getData();
    },
    // 修改条数
    SizeChange(size) {
      this.pageSize = size;
      this.getData();
    },
    // 修改页码
    currentPageChange(page) {
      this.page = page;
      this.getData();
    },
    // 删除
    handleDelete(row) {
      this.$confirm(`确认删除渠道名为 ${row.labelName} 的渠道吗？`).then(() => {
        delLabel([row.id]).then((res) => {
          if (res && res.code === 200) {
            this.$message.success(res.msg);
            this.getData();
          } else {
            this.$message.error(res.msg);
          }
        });
      });
    },
    // 编辑
    handleEdit(row) {
      console.log(row);
      // 深拷贝row对象
      let clonedRow = cloneDeep(row);
      clonedRow.couponActivityIds =
        clonedRow.couponActivityIds && clonedRow.couponActivityIds.split(",");
      clonedRow.activityIds =
        clonedRow.activityIds &&
        clonedRow.activityIds.split(",").map((id) => parseInt(id));
      if (row.delFlag === "0") {
        return this.$message.warning("需先关闭渠道");
      }
      this.params = {
        drawerType: "edit",
        drawerShow: true,
        editData: clonedRow,
      };
    },
    // 修改启用状态
     handleChangeStatus(row) {
      let delFlag = row.status ? "0" : "1";
      updateLabel({
        delFlag: delFlag,
        id: row.id,
      }).then((res) => {
        if (res && res.code === 200) {
          this.$message.success(res.msg);
        } else {
          this.$message.error(res.msg);
        }
         this.getData();
      }).catch(err=>{ 
        this.getData();
      })
      
     
    },
    // 新增窗口
    handleAdd() {
      this.params = {
        drawerType: "new",
        drawerShow: true,
        editData: {},
      };
      this.resetForm("reductionForm");
    },
    // 批量导入
    handleImportAll() {},
    // 分配明细
    handleUserDetailed(row) {
      this.labelRow = row;
      this.userDetailedVisible = true;
      this.resetForm("userDetailedForm");
      this.getSelectPhoneList(this.labelRow.id);
    },
    handleUserDetailedQuery() {
      this.getSelectPhoneList(this.labelRow.id);
    },
    resetUserDetailedQuery() {
      this.resetForm("userDetailedForm");
      this.getSelectPhoneList(this.labelRow.id);
    },
    userDetailedSizeChange(size) {
      this.userDetailedPageSize = size;
      this.getSelectPhoneList(this.labelRow.id);
    },
    userDetailedCurrentPageChange(page) {
      this.userDetailedPage = page;
      this.getSelectPhoneList(this.labelRow.id);
    },
    // 本标签下用户
    getSelectPhoneList(labelId) {
      if (this.userDetailedLoading) return;
      this.userDetailedLoading = true;
      let queryData = this.getQueryData(this.userDetailedForm);
      if (queryData.customerName)
        queryData.customerName = queryData.customerName.trim();
      if (queryData.phone) queryData.phone = queryData.phone.trim();
      queryData = Object.assign(
        {
          pageNum: this.userDetailedPage,
          pageSize: this.userDetailedPageSize,
          labelId: labelId,
        },
        queryData
      );
      selectPhoneList(queryData).then((res) => {
        if (res && res.code === 200) {
          this.userDetailedList = res.rows;
          this.userDetailedTotal = res.total;
        } else {
          this.userDetailedList = [];
          this.userDetailedTotal = 0;
        }
        this.userDetailedLoading = false;
      });
    },
    // 导出明细
    userDetailedExport() {
      selectCustomerLabelInfoListExport({
        labelId: this.labelRow.id,
        secondFlag: "1",
      }).then((res) => {
        this.download(res.msg);
      });
    },
    // 分配
    handleOptional(row) {
      this.allocationLabelVisible = true;
      this.labelRow = row;
      this.resetForm("optionalUserForm");
      this.getNotCustomerLabelInfo(this.labelRow.id);
    },
    optionalUserSelectionChange(selection) {
      this.optionalUserSelectList = selection;
    },
    // 分配保存
    optionalUserSubmit() {
      console.log(this.labelRow);
      this.$confirm(
        `确认保存勾选的用户分配至${this.labelRow.labelName}渠道吗？`
      ).then(() => {
        let data = {
          flag: this.labelRow.delFlag,
          labelId: this.labelRow.id,
          phoneList: [],
        };
        this.optionalUserSelectList.map((item) => {
          data.phoneList.push(item.phone);
        });
        addAndDelCustomerLabel(data).then((res) => {
          if (res && res.code === 200) {
            this.$message.success("保存成功");
            this.getNotCustomerLabelInfo(this.labelRow.id);
            this.getData();
          } else {
            this.$message.error(res.msg);
          }
        });
      });
    },
    optionalUserSizeChange(size) {
      this.optionalUserPageSize = size;
      this.getNotCustomerLabelInfo(this.labelRow.id);
    },
    optionalUserCurrentPageChange(page) {
      this.optionalUserPage = page;
      this.getNotCustomerLabelInfo(this.labelRow.id);
    },
    handleOptionalUserQuery() {
      this.getNotCustomerLabelInfo(this.labelRow.id);
    },
    resetOptionalUserQuery() {
      this.resetForm("optionalUserForm");
      this.getNotCustomerLabelInfo(this.labelRow.id);
    },
    getNotCustomerLabelInfo(labelId) {
      if (this.optionalUserLoading) return;
      this.optionalUserLoading = true;
      let queryData = this.getQueryData(this.optionalUserForm);
      if (queryData.customerName)
        queryData.customerName = queryData.customerName.trim();
      if (queryData.phone) queryData.phone = queryData.phone.trim();
      queryData = Object.assign(
        {
          pageNum: this.optionalUserPage,
          pageSize: this.optionalUserPageSize,
          labelId: labelId,
        },
        queryData
      );
      selectNotCustomerLabelInfo(queryData).then((res) => {
        if (res && res.code === 200) {
          this.optionalUserList = res.rows;
          this.optionalUserTotal = res.total;
        } else {
          this.optionalUserList = [];
          this.optionalUserTotal = 0;
          this.$message.error(res.msg);
        }
        this.optionalUserLoading = false;
      });
    },
    getData() {
      if (this.loading) return;
      this.loading = true;
      let queryData = this.getQueryData(this.queryParams);
      queryData = Object.assign(
        {
          pageNum: this.page,
          pageSize: this.pageSize,
        },
        queryData
      );
      labelList(queryData).then((res) => {
        if (res && res.code === 200) {
          this.labelList = res.rows;
          this.total = res.total;
          this.labelList.forEach((item) => {
            item.status = item.delFlag === "0";
          });
        } else {
          this.labelList = [];
          this.total = 0;
          this.$message.error(res.msg);
        }
        this.loading = false;
      });
    },
    getQueryData(data) {
      let queryData = data;
      Object.keys(queryData).forEach((key) => {
        if (queryData[key] === "" || queryData[key] === undefined) {
          queryData[key] = null;
        }
      });
      return queryData;
    },
  },
  mounted() {
    this.getData();
  },
};
</script>
<style lang="scss" scoped>
::v-deep .el-message-box {
  height: 40rem;
  overflow-y: scroll;
}
</style>
